﻿// ===============================================================================
// IValidatedInputControl.cs
// EOS Web Framework
// ===============================================================================
// Copyright (c) EOS Development Group. All rights reserved.
// ===============================================================================

namespace EOS.Framework.Web.Mvc.Controls
{
    /// <summary>
    /// Contract for all type safe input controls, who support validating.
    /// </summary>
    public interface IValidatedInputControl : IInputControl
    {
        /// <summary>
        /// Gets or sets the rules, which are responsible for validing the value.
        /// </summary>
        /// <value>The rules.</value>
        RulesCollection Rules { get; }

        /// <summary>
        /// Gets or sets the error message.
        /// </summary>
        /// <value>The error message.</value>
        /// <remarks>Set ErrorMessage to null, if you dont need a error message anymore.</remarks>
        string ErrorMessage { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is valid.
        /// </summary>
        /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value>
        bool IsValid { get; }
    }
}
